package create.singleton;

/**
 * Created by lie on 2017/10/30.
 * 懒汉模式，但存在线程安全问题
 */
public class LazyDemo {

    private static LazyDemo lazyDemo;

    private LazyDemo(){}

    public static LazyDemo getInstance(){
        if (lazyDemo == null) {
            lazyDemo = new LazyDemo();
        }
        return lazyDemo;
    }

}
